package ru.susu.algebra;

import java.util.Date;

import ru.susu.algebra.chartable.writer.StWorkspaceAllAlternatingGroupCharTableWriter;
import ru.susu.algebra.chartable.writer.StWorkspaceAllSymmetricGroupCharTableWriter;
import ru.susu.algebra.partition.writer.StandartAllPartitionsToWorkspaceWriter;

/**
 * В данный момент построение до 25 съедает всю память.
 * @author akargapolov
 * @since: 01.03.2009
 */
public class SymmetricCharTableViewer
{
	public static void main(String[] args) throws Exception
	{
		int i, j, k;

/*

		Set set = new HashSet();
		long sum = 0;
		for (i = 1;i<=60;i++)
		{
			List list = new PartitionsCacheConstructor().getAscendingPartitions(i,
				new AllPartitionsFilter());
			sum += list.size();
			System.out.println(i + ": " + sum );
		}*/

		for (i = 1; i <= 20; i++)
		{
			Date start = new Date();

			/*
			int N = 60;
			AlternatingGroupCharTableConstructor constructor = new AlternatingGroupCharTableConstructor();
			Partition p1 = PartitionsFactory.createPartition(1321, N);
			for (j = 1000; j <1001;j++)
			{
				Partition p2 = PartitionsFactory.createPartition(j, N);
				constructor.getValue(p2, p1);
			}*/

			StandartAllPartitionsToWorkspaceWriter partitionsWriter = new StandartAllPartitionsToWorkspaceWriter(i);
			Thread thread = new Thread(partitionsWriter);
			thread.start();

			StWorkspaceAllSymmetricGroupCharTableWriter symWriter = new StWorkspaceAllSymmetricGroupCharTableWriter();
			symWriter.write(i);

			/*MapPropertyContainer props = new MapPropertyContainer();
			BigIntegerModTransformer transformer = new BigIntegerModTransformer(BigInteger.valueOf(3));
			props.setValue(StWorkspaceAllAlternatingGroupCharTableWriter.VALUE_TRANSFORMER, transformer);*/
			StWorkspaceAllAlternatingGroupCharTableWriter altWriter = new StWorkspaceAllAlternatingGroupCharTableWriter();
			altWriter.write(i);

			Date end = new Date();
			System.out.print("Begin " + i);
			System.out.print(" end. Time: " + (end.getTime() - start.getTime()) + "\n");
		}
	}

}
